package DailyPractice.Day5;

import java.util.Scanner;

/**
 * @author lumin
 * @date 2022/04/23 11:01
 **/
public class Num1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 = sc.next();
        String str2 = sc.next();
        int count = 0;
        int index = 0;
        while(index < str1.length() + 1){
            StringBuffer sb = new StringBuffer(str1);
            if(palindrome(sb.insert(index, str2))){
                count++;
            }
            index++;
        }
        System.out.println(count);
    }


    private static boolean palindrome(StringBuffer sb) {
        int left = 0;
        int right = sb.length() - 1;
        while(left <= right){
            if(sb.charAt(left) == sb.charAt(right)){
                left++;
                right--;
            }else{
                return false;
            }
        }
        return true;
    }

}